package com.alks.function.controller;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.WebLogger;
import com.alks.common.data.thread.UserIdThread;
import com.alks.common.utils.QRCodeGenerator;
import com.alks.common.utils.excelUtils.ExcelPoiUtils;
import com.alks.common.utils.excelUtils.fluExcel.JxlsExcelUtil;
import com.alks.entity.data.entity.*;
import com.alks.entity.data.entity.excel.SampleLot;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.entity.exception.ServiceErrorException;
import com.alks.function.data.request.factoryquery.PartBfInRequest;
import com.alks.function.data.request.factoryquery.PartBfOutRequest;
import com.alks.function.data.request.factoryquery.PartStockRequest;
import com.alks.function.data.request.operate.material.MaterialDaI1Request;
import com.alks.function.data.request.order.*;
import com.alks.function.data.request.stock.PcOrderMaterialOrderDetailRequest;
import com.alks.function.data.request.yield.CollectionPointRequest;
import com.alks.function.mapper.PcOrderHeadMapping;
import com.alks.function.service.PcOrderHeadService;
import com.google.zxing.WriterException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.ExecutionException;

/**
 * @author:xxxxx
 * @create: 2023-06-26 14:14
 * @Description: 订单汇总
 */
@Api(tags = {"荣阳查询--订单/总进度/采集节点"
        ,"业务部-荣阳业务作业-订单资料建档"
        ,"业务部-荣阳业务作业-出入库扫描作业"
        ,"业务部-荣阳查询-订单汇总分析"
        ,"业务部-荣阳查询-生产动态表"
        ,"开发部-荣阳开发作业-款色资料建档"
        ,"开发部-荣阳开发作业-订单备料作业"
        ,"开发部-荣阳查询模块"})
@Slf4j
@ApiRestController("/pcOrder")
public class PcOrderController {
    @Autowired
    PcOrderHeadService pcOrderHeadService;
    @ApiOperation(value = "订单汇总",tags = {"荣阳查询--订单/总进度/采集节点"})
    @PostMapping("/pcOrderList")
    @WebLogger
    public ResponseInfo pcOrderList(@RequestBody PcOrderListRequest request){
        return pcOrderHeadService.listOrder(request);
    }

    @PostMapping("/pcAggScheduleList")
    @ApiOperation(value = "总进度查询",tags = {"荣阳查询--订单/总进度/采集节点"})
    @WebLogger
    public ResponseInfo pcAggScheduleList(@RequestBody PcAggScheduleRequest request){
        return pcOrderHeadService.pcAggScheduleList(request);
    }

    @PostMapping("/downloadPcAggSchedule")
    @ApiOperation(value = "总进度查询导出",tags = {"荣阳查询--订单/总进度/采集节点"})
    @WebLogger
    public void downloadPcAggSchedule(HttpServletResponse response) throws IOException {
         pcOrderHeadService.downloadPcAggSchedule(response);
    }

    @GetMapping("/pcLineList")
    @ApiOperation(value = "生产线",tags = {"荣阳查询--订单/总进度/采集节点"})
    @WebLogger
    public ResponseInfo pcLineList(){
        List<String> list = new ArrayList<>(Arrays.asList("成1","成2","成3","成4","成5","国友A线","国友B线","卓胜一线"));
        return ResponseInfo.ok(list);
    }

    @GetMapping("pcAggScheduleCondition")
    @ApiOperation(value = "总进度查询条件返回",tags = {"荣阳查询--订单/总进度/采集节点"})
    @WebLogger
    public ResponseInfo pcAggScheduleCondition(){
        return pcOrderHeadService.pcAggScheduleCondition();
    }

    @GetMapping("/getOrderCondition")
    @ApiOperation(value = "订单查询条件返回",tags = {"荣阳查询--订单/总进度/采集节点"})
    @WebLogger
    public ResponseInfo getOrderCondition(){
        return pcOrderHeadService.getOrderCondition();
    }

    @PostMapping("/collectionPointList")
    @ApiOperation(value = "采集节点",tags = {"荣阳查询--订单/总进度/采集节点"})
    @WebLogger
    public ResponseInfo collectionPointList(@RequestBody CollectionPointRequest request) throws ExecutionException, InterruptedException {
        return pcOrderHeadService.collectionPointList(request);
    }

    @GetMapping("/collectionPointCondition")
    @ApiOperation(value = "采集节点条件返回",tags = {"荣阳查询--订单/总进度/采集节点"})
    @WebLogger
    public ResponseInfo collectionPointCondition(){
        return pcOrderHeadService.getCollectionCondition();
    }

    //TODO 后续可以和总经办合并 根据用户级别取调用不同的数据
    @PostMapping("/getPcOrderData")
    @ApiOperation(value = "订单资料建档查询",tags = {"业务部-荣阳业务作业-订单资料建档"})
    @WebLogger
    public ResponseInfo getPcOrderData(@RequestBody PcOrderDataRequest request){
        return pcOrderHeadService.getPcOrderData(request);
    }

    @PostMapping("/importMorePhotos")
    @ApiOperation(value = "多图上传",tags = {"业务部-荣阳业务作业-订单资料建档"})
    @WebLogger
    public ResponseInfo importMorePhotos(List<MultipartFile> list){
        return pcOrderHeadService.importMorePhotos(list);
    }

    @PostMapping("/uploadPcOrderHeadTemp")
    @WebLogger
    @ApiOperation(value = "订单明细导入",tags = "业务部-荣阳业务作业-订单资料建档")
    public ResponseInfo uploadPcOrderHeadTemp(MultipartFile file){
        return pcOrderHeadService.uploadPcOrderHeadTemp(file);
    }
    //文件上传读取excel写入pc_order_head
    //量产订单导入 BatchOrderUpload
    @PostMapping("/uploadPcBatchOrder")
    @WebLogger
    @ApiOperation(value = "量产订单导入",tags = "业务部-荣阳业务作业-订单资料建档")
    public ResponseInfo uploadPcBatchOrder(MultipartFile file){
        return pcOrderHeadService.uploadPcBatchOrder(file);
    }

    //设置sample_type order_qty order_id delivery_date
    @PostMapping("/setSampleTypeWithGeneration")
    @ApiOperation(value = "设置sample_type order_qty order_id delivery_date size_no",tags = {"业务部-荣阳业务作业-订单资料建档"})
    @WebLogger
    public ResponseInfo setSampleTypeWithGeneration(@RequestBody PcOrderHead pcOrderHead){
        return pcOrderHeadService.setSampleTypeWithGeneration(pcOrderHead);
    }

    @GetMapping("/getSampleType")
    @ApiOperation(value = "获取sample_type",tags = {"业务部-荣阳业务作业-订单资料建档"})
    @WebLogger
    public ResponseInfo getSampleType(){
        return pcOrderHeadService.getSampleType();
    }

    @PostMapping("/getBomByStyleColor")
    @ApiOperation(value = "根据型体获取该型体订单号",tags = {"业务部-荣阳业务作业-订单资料建档"})
    @WebLogger
    public ResponseInfo getBomByStyleColor(@RequestBody PcStyleCraftRep rep){
        return pcOrderHeadService.getBomByStyleColor(rep);
    }


    @PostMapping("/deletePcOrderHead")
    @ApiOperation(value = "删除订单资料建档",tags = {"业务部-荣阳业务作业-订单资料建档"})
    @WebLogger
    public ResponseInfo deletePcOrderHead(@RequestBody List<String> orderIds){
        return pcOrderHeadService.deletePcOrderHead(orderIds);
    }



    @PostMapping("/downloadPcOrderDate")
    @ApiOperation(value = "样品单导出",tags = {"业务部-荣阳业务作业-订单资料建档"})
    @WebLogger
    public void downloadPcOrderDate(HttpServletResponse response, @RequestBody Map<String,Object> map) throws IOException, WriterException {
        String lotNo = (String) map.get("lotNo");
        byte[] array = QRCodeGenerator.generateQRCodeToStream(lotNo, 220, 180).toByteArray();
        ExcelPoiUtils.writeExcelWithPictureToResponse(response,"templates/订单资料建档模板.xls",map,array,12,13,0,3);
    }

    @Autowired
    PcOrderHeadMapping pcOrderHeadMapping;

    @PostMapping("/downloadPcOrderList")
    @ApiOperation(value = "订单资料建档导出",tags = {"业务部-荣阳业务作业-订单资料建档"})
    @WebLogger
    public void downloadPcOrderList(HttpServletResponse response,@RequestParam List<String> rowids){
        List<SampleLot> sampleLotList = new ArrayList<>();
        for (int i = 0; i < rowids.size(); i++) {
            SampleLot sampleLot = new SampleLot();
            sampleLot.setOrderId(rowids.get(i));
            sampleLot.setCompanyId(UserIdThread.get().getCompanyId());
            sampleLot = pcOrderHeadMapping.querySampleLotById(sampleLot);
            if (sampleLot == null) {
                throw new ServiceErrorException("指令[" + (String)rowids.get(i) + "]没有具体的数据!");
            }
            try {
                sampleLot.setOrderIdPhoto(QRCodeGenerator.generateQRCodeToStream(sampleLot.getOrderId(), 80, 80).toByteArray());
            } catch (WriterException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }

            String sheetName = sampleLot.getColor() + "#" + sampleLot.getOrderId();
            if (sheetName.length() > 32) {
                sheetName = sheetName.substring(0, 30);
            }

            sampleLot.setRemark(sheetName.replaceAll("/", "_"));
            sampleLotList.add(sampleLot);
        }
        Map<String, Object> data = new HashMap<>();
        data.put("sampleLotList", sampleLotList);
        String fileName = ((SampleLot)sampleLotList.get(0)).getCustStyle() + ((SampleLot)sampleLotList.get(0)).getSampleType();
        JxlsExcelUtil.exportExcel("/templates/sample_lot_export_more_sheet.xls", fileName, data,response);
    }
    @PutMapping("/updatePcOrderData")
    @ApiOperation(value = "订单资料建档更新",tags = {"业务部-荣阳业务作业-订单资料建档"})
    @WebLogger
    public ResponseInfo updatePcOrderData(@RequestBody PcOrderDateUpdate request){
        return pcOrderHeadService.updatePcOrderData(request);
    }

    //TODO 业务订单资料建档 图片维护查询
    @PostMapping("/shoe/getPcOrderShoePhotoFix")
    @ApiOperation(value = "鞋图维护",tags = {"业务部-荣阳业务作业-订单资料建档"})
    @WebLogger
    public ResponseInfo getPcOrderShoePhotoFix(@RequestBody PcOrderShoePhotoFixRequest request){
        return pcOrderHeadService.getPcOrderShoePhotoFix(request);
    }

    //TODO 鞋图更新
    @PostMapping("/shoe/updateShoePhoto")
    @ApiOperation(value = "上传图片并更新",tags = {"业务部-荣阳业务作业-订单资料建档"})
    @WebLogger
    public ResponseInfo updateShoePhoto(@RequestParam(value = "file")MultipartFile  file,@RequestParam String style,@RequestParam String color) {
        return pcOrderHeadService.updateShoePhoto(file,style,color);
    }

    //TODO 鞋图更新更新资料
    @ApiOperation(value = "鞋图维护更新资料",tags = {"业务部-荣阳业务作业-订单资料建档"})
    @PutMapping("/shoe/upDateShoeDetail")
    @WebLogger
    public ResponseInfo upDateShoeDetail(@RequestBody PcOrderShoePhotoFixRep request){
        return pcOrderHeadService.upDateShoeDetail(request);
    }

    //TODO 订单结案恢复
    @ApiOperation(value = "订单批量结案/恢复",tags = {"业务部-荣阳业务作业-订单资料建档"})
    @PutMapping("/updatePcOrderDataSac")
    @WebLogger
    public ResponseInfo updatePcOrderDataSac(@RequestBody PcOrderDataSacRequest request){
        return pcOrderHeadService.updatePcOrderDataSac(request);
    }

    @GetMapping("/getPcOrderDataRsjCondition")
    @ApiOperation(value = "入库扫描作业条件返回",tags = {"业务部-荣阳业务作业-出入库扫描作业"})
    @WebLogger
    public ResponseInfo getPcOrderDataRsjCondition(){
        return pcOrderHeadService.getPcOrderDataRsjCondition();
    }

    @PostMapping("/getPcOrderDataRsj")
    @ApiOperation(value = "入库扫描作业",tags = {"业务部-荣阳业务作业-出入库扫描作业"})
    @WebLogger
    public ResponseInfo getPcOrderDataRsj(@RequestBody PcOrderDataRsjRequest request,@RequestParam @ApiParam(value = "1:查询 2：查询所有采集") String choose){
        return pcOrderHeadService.getPcOrderDataRsj(request,choose);
    }

    @PostMapping("/scanInStockOption")
    @ApiOperation(value = "扫描入库",tags = {"业务部-荣阳业务作业-出入库扫描作业"})
    @WebLogger
    public ResponseInfo scanInStockOption(@RequestParam String lotNo){
//        return pcOrderHeadService.scanInStockOption(lotNo);
        return null;
    }

    //出货扫描
    @PostMapping("/out/getPcOrderDataTbs")
    @ApiOperation(value = "出货扫描作业-待出货明细",tags = {"业务部-荣阳业务作业-出入库扫描作业"})
    @WebLogger
    public ResponseInfo getPcOrderDataTbs(@RequestBody PcOrderDataTbsRequest request){
        return pcOrderHeadService.getPcOrderDataTbs(request);
    }

    //选择出货
    @PostMapping("/out/outPcOrderDataTbs")
    @ApiOperation(value = "选择出货",tags = {"业务部-荣阳业务作业-出入库扫描作业"})
    @WebLogger
    public ResponseInfo outPcOrderDataTbs(@RequestBody PcOrderDataInOutRequest request){
        return pcOrderHeadService.outPcOrderDataTbs(request);
    }

    //出货扫描作业采集记录
    @PostMapping("/out/pcOrderDataOutRecord")
    @ApiOperation(value = "出货扫描作业查询",tags = {"业务部-荣阳业务作业-出入库扫描作业"})
    @WebLogger
    public ResponseInfo pcOrderDataOutRecord(@RequestBody PcOrderDataTbsRequest request){
        return pcOrderHeadService.PcOrderDataOutRecord(request);
    }

    @PostMapping("/out/pcOrderDataDeleteRecord")
    @ApiOperation(value = "删除扫描记录",tags = {"业务部-荣阳业务作业-出入库扫描作业"})
    @WebLogger
    public ResponseInfo pcOrderDataDeleteRecord(@RequestBody PcOrderDataInOutRequest  request){
        return pcOrderHeadService.pcOrderDataDeleteRecord(request);
    }

    //订单汇总分析条件返回
    @GetMapping("/summary/pcOrderDataSummaryAlsCondition")
    @ApiOperation(value = "订单汇总分析条件/生产动态表返回",tags = {"业务部-荣阳查询-订单汇总分析"})
    @WebLogger
    public ResponseInfo pcOrderDataSummaryAlsCondition(){
        return pcOrderHeadService.pcOrderDataSummaryAlsCondition();
    }

    //订单汇总分析
    @PostMapping("/summary/pcOrderDataSummaryAls")
    @ApiOperation(value = "订单汇总分析",tags = {"业务部-荣阳查询-订单汇总分析"})
    @WebLogger
    public ResponseInfo pcOrderDataSummaryAls(@RequestBody PcOrderSummaryAnalysisRequest request){
        return pcOrderHeadService.pcOrderDataSummaryAls(request);
    }
    //订单汇总分析导出

    @PostMapping("/summary/downloadOrderDataSummaryAls")
    @ApiOperation(value = "订单汇总分析导出",tags = {"业务部-荣阳查询-订单汇总分析"})
    @WebLogger
    public void downloadOrderDataSummaryAls(@RequestBody PcOrderSummaryAnalysisRequest request,HttpServletResponse response) throws IOException {
         pcOrderHeadService.downloadOrderDataSummaryAls(request,response);
    }

    //业务部-生产动态表
    @PostMapping("/dt/pcProductionDt")
    @ApiOperation(value = "生产动态表",tags = {"业务部-荣阳查询-生产动态表"})
    @WebLogger
    public ResponseInfo pcProductionDt(@RequestBody PcProductionDtRequest request){
        return pcOrderHeadService.pcProductionDt(request);
    }

    @PutMapping("/updatePcOrderTable")
    @ApiOperation(value = "更新生产动态表",tags = {"业务部-荣阳查询-生产动态表"})
    @WebLogger
    public ResponseInfo updatePcOrderTable(){
        return pcOrderHeadService.updatePcOrderTable();
    }

    //修改生产动态表的计划日期
    @PutMapping("/dt/updatePcProductionDtPlanDate")
    @ApiOperation(value = "修改生产动态表的计划日期和欠数",tags = {"业务部-荣阳查询-生产动态表"})
    @WebLogger
    public ResponseInfo updatePcProductionDtPlanDate(@RequestBody PcProdStatus request){
        return pcOrderHeadService.updatePcProductionDtPlanDate(request);
    }




    //更新生产动态表

    //生产动态表下载

    @PostMapping("/downloadPcProductDt")
    @WebLogger
    @ApiOperation(value = "生产动态表下载",tags = {"业务部-荣阳查询-生产动态表"})
    public void downloadPcProductDt(HttpServletResponse response,@RequestBody PcProductionDtRequest request) throws IOException {
        pcOrderHeadService.downloadPcProductDt(response,request);
    }

    //标注指令结束
    @PostMapping("/dt/pcProductionDtMark")
    @ApiOperation(value = "标注指令已结束",tags = {"业务部-荣阳查询-生产动态表"})
    @WebLogger
    public ResponseInfo pcProductionDtMarkOk(@RequestParam(value = "lotNo") String lotNo){
        return pcOrderHeadService.updatePcProdMarkOk(lotNo);
    }

    //查询标注结束指令
    @GetMapping("/dt/pcProductionDtMarkGet")
    @ApiOperation(value = "查询标注结束指令",tags = {"业务部-荣阳查询-生产动态表"})
    @WebLogger
    public ResponseInfo pcProductionDtMarkGet(){
        return pcOrderHeadService.pcProductionDtMarkGet();
    }

    //取消标注
    @PostMapping("/dt/pcProductionDtCancelMarkOk")
    @ApiOperation(value = "取消标注",tags = {"业务部-荣阳查询-生产动态表"})
    @WebLogger
    public ResponseInfo pcProductionDtCancelMarkOk(@RequestParam(value = "lotNo") String lotNo){
        return pcOrderHeadService.updatePcProdCancelMarkOk(lotNo);
    }

    //TODO 款色资料建档
    @PostMapping("/shoe/pcOrderStyleColorDd")
    @ApiOperation(value = "款色资料建档",tags = {"开发部-荣阳开发作业-款色资料建档"})
    @WebLogger
    public ResponseInfo pcOrderStyleColorDd(@RequestBody PcOrderShoePhotoFixRequest request){
        return pcOrderHeadService.pcOrderStyleColorDd(request);
    }

    //TODO 款色资料建档 检核/取消检核
    @PostMapping("/shoe/pcOrderStyleColorDdCheck")
    @ApiOperation(value = "款色资料建档--检核/取消检核",tags = {"开发部-荣阳开发作业-款色资料建档"})
    @WebLogger
    public ResponseInfo pcOrderStyleColorDdCheck(@RequestBody PcOrderStyleColorDdCheckRequest request){
        return pcOrderHeadService.pcOrderStyleColorDdCheck(request);
    }

    //TODO 款色资料建档 订单明细
    @GetMapping("/shoe/pcOrderStyleColorDdDetail")
    @ApiOperation(value = "款色资料建档--订单明细",tags = {"开发部-荣阳开发作业-款色资料建档"})
    @WebLogger
    public ResponseInfo pcOrderStyleColorDdDetail(@RequestParam String lotNo){
        return pcOrderHeadService.pcOrderStyleColorDdDetail(lotNo);
    }


    @PutMapping("/shoe/updatePcOrderStyleColorDdDetail")
    @ApiOperation(value = "款色资料建档--修改订单明细",tags = {"开发部-荣阳开发作业-款色资料建档"})
    @WebLogger
    public ResponseInfo updatePcOrderStyleColorDdDetail(@RequestBody PcOrderStyleColorDdDetailRep request){
        return pcOrderHeadService.updatePcOrderStyleColorDdDetail(request);
    }

    //TODO 开发部-开发作业-订单备料作业
    @WebLogger
    @PostMapping("/operate/getPickingOperate")
    @ApiOperation(value = "订单备料作业-待备料的订单资料",tags = "开发部-荣阳开发作业-订单备料作业")
    public ResponseInfo getPickingOperate(@RequestBody PcOrderPickingOperateRequest request){
        return pcOrderHeadService.getPickingOperate(request);
    }

    //TODO 开发部-开发作业-订单备料作业  PcOrderPickingOperateDetailRep
    @WebLogger
    @PostMapping("/operate/getPickingOperateDetail")
    @ApiOperation(value = "订单备料作业-订单材料明细",tags = "开发部-荣阳开发作业-订单备料作业")
    public ResponseInfo getPickingOperateDetail(@RequestParam String lotNo){
        return pcOrderHeadService.getPickingOperateDetail(lotNo);
    }

    //开发部-开发作业-订单材料明细修改数据
    @WebLogger
    @PostMapping("/operate/updatePickingOperate1")
    @ApiOperation(value = "订单备料作业-订单材料明细修改",tags = "开发部-荣阳开发作业-订单备料作业")
    public ResponseInfo updatePickingOperate1(@RequestBody PcOrderPickingOperateDetailRep request){
        return pcOrderHeadService.updatePickingOperate1(request);
    }
    //TODO 开发部-开发作业-订单备料作业 分类辅助生成
    @WebLogger
    @PostMapping("/operate/setTypeNameInPickingOperate")
    @ApiOperation(value = "订单备料作业-分类辅助生成",tags = "开发部-荣阳开发作业-订单备料作业")
    public ResponseInfo setTypeNameInPickingOperate(@RequestBody PcOrderCTN request){
        return pcOrderHeadService.setTypeNameInPickingOperate(request);
    }

    //TODO 开发部-开发作业-订单备料作业 生成物料编码 置空物料编码
    @WebLogger
    @PostMapping("/operate/setMtlNoInPickingOperate")
    @ApiOperation(value = "订单备料作业-生成/置空物料编码",tags = "开发部-荣阳开发作业-订单备料作业")
    public ResponseInfo setMtlNoInPickingOperate(@RequestBody PcOrderMtlNoPAndERequest request){
        return pcOrderHeadService.setMtlNoInPickingOperate(request);
    }

    //TODO 开发部-开发作业-订单备料作业 打勾指令材料复制到指令
    @WebLogger
    @PostMapping("/operate/setMtlNoCopyInLotNo")
    @ApiOperation(value = "打勾指令材料复制到指令/打勾记录检核/打勾记录取消检核",tags = "开发部-荣阳开发作业-订单备料作业")
    public ResponseInfo setMtlNoCopyInLotNo(@RequestBody PcOrderMtlNoPAndERequest request){
        return pcOrderHeadService.setMtlNoCopyInLotNo(request);
    }

    //TODO 订单屏蔽/取消屏蔽
    @WebLogger
    @PostMapping("/operate/pcOrderShielding")
    @ApiOperation(value = "订单屏蔽/取消屏蔽",tags = "开发部-荣阳开发作业-订单备料作业")
    public ResponseInfo pcOrderShielding(@RequestBody PcOrderShieldingRequest request){
        return pcOrderHeadService.pcOrderShielding(request);
    }

    @PostMapping("/operate/pcOrderShieldingList")
    @ApiOperation(value = "屏蔽取消",tags = "开发部-荣阳开发作业-订单备料作业")
    @WebLogger
    public ResponseInfo pcOrderShieldingList(@RequestParam(required = false) String  lotNo,@RequestParam(required = false) Integer pageNum,@RequestParam(required = false) Integer pageSize){
        return pcOrderHeadService.pcOrderShieldingList(lotNo,pageNum,pageSize);
    }

    //订单材料明细添加以及删除
    @PostMapping("/operate/pcOrderMaterialDaI1")
    @ApiOperation(value = "订单明细插入以及删除",tags = "开发部-荣阳开发作业-订单备料作业")
    @WebLogger
    public ResponseInfo pcOrderMaterialDaI1(@RequestBody MaterialDaI1Request request){
        return pcOrderHeadService.pcOrderMaterialDaI1(request);
    }

    //勾选指令刷新材料单
    @PostMapping("/operate/refreshOrderMaterialDaI2")
    @ApiOperation(value = "勾选指令刷新材料单",tags = "开发部-荣阳开发作业-订单备料作业")
    @WebLogger
    public ResponseInfo  refreshOrderMaterialDaI2(@RequestBody List<String> lotNos){
        return pcOrderHeadService.refreshOrderMaterialDaI2(lotNos);
    }

    //开发部-出货资料查询
    @PostMapping("/outStockMessageList")
    @ApiOperation(value = "出货资料查询",tags = "开发部-荣阳查询模块")
    @WebLogger
    public ResponseInfo outStockMessageList(@RequestBody PcOrderSummaryAnalysisRequest request){
        return pcOrderHeadService.outStockMessageList(request);
    }

    @PostMapping("/mtlPurList")
    @ApiOperation(value = "材料订购查询",tags = "开发部-荣阳查询模块")
    @WebLogger
    public ResponseInfo mtlPurList(@RequestBody PcOrderMaterialOrderDetailRequest request){
        return pcOrderHeadService.mtlPurList(request);
    }

    @PostMapping("/downloadMtlPurList")
    @ApiOperation(value = "大底/材料订购下载",tags = "开发部-荣阳查询模块")
    @WebLogger
    public void downloadMtlPurList(HttpServletResponse response,@RequestBody PcOrderMaterialOrderDetailRequest request) throws IOException{
        pcOrderHeadService.downloadMtlPurList(response,request);
    }

    @PostMapping("/getInPcSlipPart")
    @ApiOperation(value = "制具&耗品入库查询",tags = "开发部-荣阳查询模块")
    @WebLogger
    public ResponseInfo getInPcSlipPart(@RequestBody PartBfInRequest request){
        return pcOrderHeadService.getPcSlipPart(request);
    }

    @PostMapping("/downloadInSlipPart")
    @ApiOperation(value = "制具&耗品入库导出",tags = "开发部-荣阳查询模块")
    @WebLogger
    public void downloadInSlipPart(HttpServletResponse response,@RequestBody PartBfInRequest request) throws IOException {
        pcOrderHeadService.downloadInSlipPart(response,request);
    }

    @PostMapping("/getOutPcSlipPart")
    @ApiOperation(value = "制具&耗品出库查询",tags = "开发部-荣阳查询模块")
    @WebLogger
    public ResponseInfo getOutPcSlipPart(@RequestBody PartBfOutRequest request){
        return pcOrderHeadService.getOutPcSlipPart(request);
    }

    @PostMapping("/downloadOutPart")
    @ApiOperation(value = "制具&耗品出库导出",tags = "开发部-荣阳查询模块")
    @WebLogger
    public void downloadOutPart(HttpServletResponse response,@RequestBody PartBfOutRequest request) throws IOException {
        pcOrderHeadService.downloadOutPart(response,request);
    }

    @PostMapping("/getStockPcSlipPart")
    @ApiOperation(value = "制具&耗品库存查询",tags = "开发部-荣阳查询模块")
    @WebLogger
    public ResponseInfo getStockPcSlipPart(@RequestBody PartStockRequest request){
        return pcOrderHeadService.getStockPcSlipPart(request);
    }


    @PostMapping("/downloadStockPart")
    @ApiOperation(value = "制具&耗品库存导出",tags = "开发部-荣阳查询模块")
    @WebLogger
    public void downloadStockPart(HttpServletResponse response,@RequestBody PartStockRequest request) throws IOException {
        pcOrderHeadService.downloadStockPart(response,request);
    }

    //出入库返回 PcSlipDetailPart
    @PostMapping("/getStockOutAndIn")
    @WebLogger
    @ApiOperation(value = "制具&耗品出入库明细查询",tags = "开发部-荣阳查询模块")
    public ResponseInfo getStockOutAndIn(@RequestParam String mtlNo){
        return pcOrderHeadService.getStockOutAndIn(mtlNo);
    }
}
